﻿namespace YasharEl.Infrastructure.ApplicationModel.Bootstrap.Configuration.Internals
{
    using System.Collections.Generic;
    using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensibility;

    /// <summary>
    /// Default IConsumeConfiguration
    /// </summary>
    public class ConsumeConfiguration : IConsumeConfiguration
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConsumeConfiguration"/> class.
        /// </summary>
        /// <param name="extension">The extension.</param>
        public ConsumeConfiguration(IBootstrappingExtension extension)
        {
            var consumeConfiguration = extension as IConsumeConfiguration;

            this.Configuration = consumeConfiguration != null
                ? consumeConfiguration.Configuration
                : new Dictionary<string, string>();
        }

        /// <summary>
        /// Gets the configuration dictionary which is filled by the producer.
        /// </summary>
        public IDictionary<string, string> Configuration { get; private set; }
    }
}